home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 23 / Macromedia xRes Versión 2.0 completa (Spain) / MF 23 Gr ficos.bin / xRes 2.0 SE / Access / XresACCESS_SE.Dxr / 00002_More Main Movie Scripts.ls < prev    next >
Encoding:
Text File  |  1996-04-05  |  20.9 KB  |  564 lines

  1. global gthePath, startColorDepth, startSoundVolume, gProgramInstalled, gREADME3, gREADME4, gREADME5, gREADME6, gREADME3Menu, gREADME4Menu, gREADME5Menu, gREADME6Menu, PAGELENGTH, gCurrentPage, gCurrentMenu, gMenuItemClicked, gTotalPages, gCurrentTextField, gCurrentSection, gCurrentTopic, gCurrentSubTopic, gTheFindHitLine, gMenuList, gMenuStructureList, pathSeparator, gMediaPath, gAppSuffix, gCurrentSubMenuLines, gImageChannel, gMovieChannel, gImageSuffix, gMovieSuffix, gTextFieldChannel, gNextPageChannel, gPrevPageChannel, videoPlaying, MIAWPlaying, myMIAW, gPrintButtonChannel, gHiliteChannel, dontDoRolloverUntil, gBlinkNextPage, gHeadingChannel, QTsliderChannel, QTsliderConstraint, QTPlayChannel, QTRewindChannel, QTFFChannel, QTStopChannel, alertBoxChannel, alertTextChannel, alertOkayChannel, alertCancelChannel, alertLeftButtonText, alertRightButtonText, theActiveMenuSprite, gOkayAction, gCancelAction, alertBoxShowing, videoPlayState, soundPlaying, helpBoxChannel, helpTextChannel, helpDelayTicks, helpMouseLoc, lastHelpOff, gMacInstallPath, gPCInstallPath, gMacCDName, NewSelectPoint, gNextAttractNum, gNextAttractTime, gAttractNumberList, waitBetweenAttract, gNextPageDownCast, gPrevPageDownCast, gNextPageUpCast, gPrevPageUpCast, spinnerCastList, ImageAndTextBG, ImageBG, QTBG, GrayHilite, BlackHilite, BigHelp, SmallHelp, ZoomText, zoomableImage, SubMenuWindow, gSubMenuLine, MIAWPath, theLaunchList
  2.  
  3. on processSubMenu thePassedInLine
  4.   if thePassedInLine > 0 then
  5.     set theMenuLine to thePassedInLine
  6.   else
  7.     set theMenuLine to gSubMenuLine
  8.   end if
  9.   set gMenuItemClicked to line theMenuLine of field "Submenu"
  10.   if gCurrentSection = "Install" then
  11.     if gMenuItemClicked contains "Install " then
  12.       doInstall()
  13.     end if
  14.   end if
  15.   displaySubMenu(thePassedInLine)
  16. end
  17.  
  18. on newDisplayText aMenuList, destinationField, thePassedInLine
  19.   global gCurrentMenuHierarchy, gCurrentPageList, gCurrentLevelSelect
  20.   set depthCount to count(gCurrentMenuHierarchy)
  21.   set currentDepth to getAt(gCurrentLevelSelect, 1)
  22.   set currentSelectionAtDepth to getAt(gCurrentLevelSelect, 2)
  23.   if currentDepth > 1 then
  24.     repeat with i = 1 to depthCount
  25.       if i = currentDepth then
  26.         exit repeat
  27.       end if
  28.       set theMenuList to getAt(aMenuList, getAt(gCurrentMenuHierarchy, i))
  29.       set aMenuList to getaProp(theMenuList, #SubMenu)
  30.     end repeat
  31.     set theMenu to getAt(aMenuList, currentSelectionAtDepth)
  32.   else
  33.     set theMenu to getAt(aMenuList, currentSelectionAtDepth)
  34.   end if
  35.   set gCurrentPageList to getProp(theMenu, #PageList)
  36.   set gTotalPages to count(gCurrentPageList)
  37.   set gCurrentPage to 1
  38.   DisplayThePage(destinationField, thePassedInLine)
  39.   if gTotalPages > 1 then
  40.     set gBlinkNextPage to [the ticks + 60, the ticks + 80, the ticks + 100]
  41.   end if
  42. end
  43.  
  44. on CleanUpPage
  45.   global gFirstMenuChannel
  46.   if videoPlaying then
  47.     set videoPlaying to 0
  48.     spriteVisibles(27, 31, 0)
  49.     set the locH of sprite QTsliderChannel to -1000
  50.     puppetSprite(QTsliderChannel, 0)
  51.     set the visible of sprite QTsliderChannel to 0
  52.   end if
  53.   if MIAWPlaying = 1 then
  54.     if objectp(myMIAW) then
  55.       forget(myMIAW)
  56.     end if
  57.     set MIAWPlaying to 0
  58.     spriteVisibles(27, 31, 0)
  59.     set the locH of sprite QTsliderChannel to -1000
  60.     puppetSprite(QTsliderChannel, 0)
  61.     set the visible of sprite QTsliderChannel to 0
  62.   end if
  63.   set the locH of sprite gImageChannel to -1000
  64.   set the cursor of sprite gMovieChannel to 0
  65.   set zoomableImage to 0
  66.   set the locH of sprite gMovieChannel to -1000
  67.   set the locH of sprite gTextFieldChannel to -1000
  68.   repeat with i = gFirstMenuChannel to gFirstMenuChannel + 5
  69.     set the locH of sprite i to -1000
  70.   end repeat
  71.   updateStage()
  72.   set theLaunchList to EMPTY
  73.   set the visible of sprite gImageChannel to 0
  74.   set the visible of sprite gMovieChannel to 0
  75.   puppetSprite(gMovieChannel, 0)
  76.   set the visible of sprite gTextFieldChannel to 0
  77. end
  78.  
  79. on DisplayThePage destinationField, thePassedInLine
  80.   global gCurrentPageList, gTextFieldChannel, gPlatformNum, gCurrentMenuList, gFirstMenuChannel, gMagCurs, gMagCursMask
  81.   if thePassedInLine > 0 then
  82.     return 
  83.   end if
  84.   CleanUpPage()
  85.   set underLineList to []
  86.   set numPages to count(gCurrentPageList)
  87.   if gCurrentPage <= numPages then
  88.     set thePage to getAt(gCurrentPageList, gCurrentPage)
  89.     set thePageText to getaProp(thePage, #PageText)
  90.     if stringp(thePageText) then
  91.       set line1 to value(word 1 of thePageText)
  92.       set line2 to value(word 2 of thePageText)
  93.       set theCastNum to value(word 3 of thePageText)
  94.       set theText to getFullText(theCastNum, line2)
  95.       set newText to line line1 to line2 of theText
  96.       repeat while newText contains "<"
  97.         set startChar to offset("<", newText)
  98.         set endChar to offset(">", newText)
  99.         delete char endChar of newText
  100.         delete char startChar of newText
  101.         append(underLineList, [startChar, endChar - 2])
  102.       end repeat
  103.     else
  104.       set newText to EMPTY
  105.     end if
  106.     set pageImageList to getaProp(thePage, #pageImage)
  107.     if listp(pageImageList) then
  108.       set pageImage to getAt(pageImageList, gPlatformNum)
  109.     end if
  110.     set pageMovieList to getaProp(thePage, #pageMovie)
  111.     if listp(pageMovieList) then
  112.       set pageMovie to getAt(pageMovieList, gPlatformNum)
  113.     end if
  114.     set pageMIAWList to getaProp(thePage, #pageMovieInAWindow)
  115.     if listp(pageMIAWList) then
  116.       set pageMovieInAWindow to getAt(pageMIAWList, gPlatformNum)
  117.     end if
  118.     set launchList to getaProp(thePage, #PageLaunch)
  119.     set pageAppList to getaProp(thePage, #pageApp)
  120.     if listp(pageAppList) then
  121.       set pageApp to getAt(pageAppList, gPlatformNum)
  122.     end if
  123.     set zoomImageList to getaProp(thePage, #zoomImage)
  124.     if listp(zoomImageList) then
  125.       set zoomImage to getAt(zoomImageList, gPlatformNum)
  126.     end if
  127.     puppetSprite(gTextFieldChannel, 1)
  128.     if listp(launchList) then
  129.       set fieldLoc to point(313, 143)
  130.     else
  131.       if stringp(pageImage) or stringp(pageMovie) or stringp(zoomImage) then
  132.         set fieldLoc to point(213, 362)
  133.       else
  134.         set fieldLoc to point(213, 143)
  135.       end if
  136.     end if
  137.     if stringp(pageApp) then
  138.       if (the machineType = 256) and not (pageApp contains gAppSuffix) then
  139.         put "." & gAppSuffix after pageApp
  140.       end if
  141.       set theAppToRun to gMediaPath & pageApp
  142.     end if
  143.     set showMovieChannel to 0
  144.     if stringp(pageImage) then
  145.       if the machineType = 256 then
  146.         set suffixOffset to offset(".", pageImage) - 1
  147.         set theImagebase to char 1 to suffixOffset of pageImage
  148.         set theImage to theImagebase & "." & gImageSuffix
  149.       else
  150.         set theImagebase to EMPTY
  151.         set theImage to pageImage
  152.       end if
  153.       set imageCastNum to the number of member theImage
  154.       if (imageCastNum < 0) and (theImagebase <> EMPTY) then
  155.         set imageCastNum to the number of member theImagebase
  156.       end if
  157.       if imageCastNum < 0 then
  158.         makeAlertBox([#PictureNotFound, theImage], "doCancel")
  159.         set showMovieChannel to 0
  160.         set showImageChannel to 0
  161.       else
  162.         if newText <> EMPTY then
  163.           set bgCastNum to ImageAndTextBG
  164.           set MovieLoc to point(417, 246)
  165.           set showImageChannel to 1
  166.         else
  167.           set bgCastNum to ImageBG
  168.           set picWidth to the width of cast imageCastNum
  169.           set picHeight to the height of cast imageCastNum
  170.           if (picWidth <= 320) and (picHeight <= 240) then
  171.             set xloc to 579 - (picWidth / 2)
  172.             set yloc to 387 - (picHeight / 2)
  173.             set MovieLoc to point(xloc, yloc)
  174.           else
  175.             set MovieLoc to point(416, 292)
  176.           end if
  177.           set showImageChannel to 1
  178.         end if
  179.         set showMovieChannel to 1
  180.         puppetSprite(gMovieChannel, 1)
  181.         puppetSprite(gImageChannel, 1)
  182.         set ImageLoc to point(415, 300)
  183.         set the castNum of sprite gImageChannel to bgCastNum
  184.         set the castNum of sprite gMovieChannel to imageCastNum
  185.         preLoadCast(bgCastNum)
  186.         preLoadCast(imageCastNum)
  187.       end if
  188.     else
  189.       set showImageChannel to 0
  190.     end if
  191.     if listp(launchList) then
  192.       set numItems to count(launchList)
  193.       set theLaunchList to [:]
  194.       set the itemDelimiter to ","
  195.       repeat with i = 1 to numItems
  196.         set theSpriteChan to gFirstMenuChannel + i - 1
  197.         set theLaunchInfo to getAt(launchList, i)
  198.         set theAppName to item 1 of theLaunchInfo
  199.         set theMacDocName to item 2 of theLaunchInfo
  200.         set theDocName to item gPlatformNum + 1 of theLaunchInfo
  201.         if theMacDocName = EMPTY then
  202.           set oldDelimiter to the itemDelimiter
  203.           set the itemDelimiter to ":"
  204.           set theIconName to item the number of items in theAppName of theAppName
  205.           set theIconName to theIconName && "icon"
  206.           set the itemDelimiter to oldDelimiter
  207.           if the machineType = 256 then
  208.             set theAppName to theDocName
  209.           end if
  210.           set theDocName to EMPTY
  211.         else
  212.           if theDocName <> EMPTY then
  213.             set oldDelimiter to the itemDelimiter
  214.             set the itemDelimiter to ":"
  215.             set theIconName to item the number of items in theMacDocName of theMacDocName
  216.             set theIconName to theIconName && "icon"
  217.             set the itemDelimiter to oldDelimiter
  218.           else
  219.             set theIconName to theAppName && "icon"
  220.           end if
  221.         end if
  222.         set the castNum of sprite theSpriteChan to the number of member theIconName
  223.         set the locH of sprite theSpriteChan to 248
  224.         set the visible of sprite theSpriteChan to 1
  225.         addProp(theLaunchList, theSpriteChan, theAppName & "," & theDocName)
  226.       end repeat
  227.     end if
  228.     if stringp(zoomImage) then
  229.       if the machineType = 256 then
  230.         set suffixOffset to offset(".", zoomImage) - 1
  231.         set theImagebase to char 1 to suffixOffset of zoomImage
  232.         set theImage to theImagebase & "." & gImageSuffix
  233.       else
  234.         set theImagebase to EMPTY
  235.         set theImage to zoomImage
  236.       end if
  237.       set imageCastNum to the number of member theImage
  238.       if (imageCastNum < 0) and (theImagebase <> EMPTY) then
  239.         set imageCastNum to the number of member theImagebase
  240.       end if
  241.       if imageCastNum < 0 then
  242.         makeAlertBox([#PictureNotFound, theImage], "doCancel")
  243.         set showMovieChannel to 0
  244.         set showImageChannel to 0
  245.       else
  246.         set bgCastNum to ImageAndTextBG
  247.         set MovieLoc to point(417, 246)
  248.         set showImageChannel to 1
  249.         set showMovieChannel to 1
  250.         puppetSprite(gMovieChannel, 1)
  251.         puppetSprite(gImageChannel, 1)
  252.         set ImageLoc to point(415, 300)
  253.         set the castNum of sprite gImageChannel to bgCastNum
  254.         set the castNum of sprite gMovieChannel to imageCastNum
  255.         preLoadCast(bgCastNum)
  256.         preLoadCast(imageCastNum)
  257.         set the stretch of sprite gMovieChannel to 1
  258.         set the width of sprite gMovieChannel to 256
  259.         set the height of sprite gMovieChannel to 192
  260.         set curs to gMagCurs
  261.         set cursMask to gMagCursMask
  262.         set the cursor of sprite gMovieChannel to [curs, cursMask]
  263.         set zoomableImage to 1
  264.       end if
  265.     else
  266.       set the stretch of sprite gMovieChannel to 0
  267.       set the cursor of sprite gMovieChannel to 0
  268.       set zoomableImage to 0
  269.     end if
  270.     if stringp(pageMovie) then
  271.       set onPC to the machineType = 256
  272.       set usingVFW to gMovieSuffix contains "AVI"
  273.       set MacVidInstalled to not onPC and the quickTimePresent
  274.       if usingVFW then
  275.         set WinVidInstalled to onPC and the videoForWindowsPresent
  276.       else
  277.         set WinVidInstalled to onPC and the quickTimePresent
  278.       end if
  279.       if not (MacVidInstalled or WinVidInstalled) then
  280.         if onPC then
  281.           if usingVFW then
  282.             makeAlertBox(#VFWNotInstalled, "doCancel", "doCancel")
  283.           else
  284.             makeAlertBox(#QTWNotInstalled, "doCancel", "doCancel")
  285.           end if
  286.         else
  287.           makeAlertBox(#QuickTimeNotInstalled, "doCancel", "doCancel")
  288.         end if
  289.         set pageMovie to 0
  290.       else
  291.         if onPC then
  292.           set suffixOffset to offset(".", pageMovie) - 1
  293.           set theMovieBase to char 1 to suffixOffset of pageMovie
  294.           set theMovie to theMovieBase & "." & gMovieSuffix
  295.         else
  296.           set theMovieBase to EMPTY
  297.           set theMovie to pageMovie
  298.         end if
  299.         set MovieCastNum to the number of member theMovie
  300.         if (MovieCastNum < 0) and (theMovieBase <> EMPTY) then
  301.           set MovieCastNum to the number of member theMovieBase
  302.         end if
  303.         if MovieCastNum < 0 then
  304.           makeAlertBox([#VideoNotFound, theMovie], "doCancel", "doCancel")
  305.           set showMovieChannel to 0
  306.           set videoPlaying to 0
  307.           set pageMovie to 0
  308.         else
  309.           puppetSprite(gMovieChannel, 1)
  310.           set the castNum of sprite gImageChannel to QTBG
  311.           set ImageLoc to point(416, 300)
  312.           set the type of sprite gMovieChannel to 16
  313.           set the pausedAtStart of cast MovieCastNum to 1
  314.           set the directToStage of cast MovieCastNum to 1
  315.           set the castNum of sprite gMovieChannel to MovieCastNum
  316.           set MovieLoc to point(421, 280)
  317.           set showImageChannel to 1
  318.           set showMovieChannel to 1
  319.           set videoPlaying to 1
  320.         end if
  321.       end if
  322.     else
  323.       set videoPlaying to 0
  324.     end if
  325.     if stringp(pageMovieInAWindow) then
  326.       set theMIAW to pageMovieInAWindow
  327.       if objectp(myMIAW) then
  328.         forget(myMIAW)
  329.       end if
  330.       set sl to the stageLeft
  331.       set st to the stageTop
  332.       set MIAWRect to rect(sl + 261, st + 160, sl + 580, st + 399)
  333.       if the machineType = 256 then
  334.         set theSep to "\"
  335.       else
  336.         set theSep to ":"
  337.       end if
  338.       set myPath to MIAWPath & theMIAW
  339.       set myMIAW to window "Learning Movie"
  340.       if objectp(myMIAW) then
  341.         set the rect of myMIAW to MIAWRect
  342.         set the fileName of myMIAW to myPath
  343.         set the titleVisible of myMIAW to 0
  344.         set the castNum of sprite gImageChannel to QTBG
  345.         set ImageLoc to point(416, 300)
  346.         set showImageChannel to 1
  347.         set MIAWPlaying to 1
  348.       else
  349.         makeAlertBox([#MovieInAWindowNotFound, pageMovieInAWindow], "doCancel", "doCancel")
  350.       end if
  351.     end if
  352.   else
  353.     set newText to EMPTY
  354.   end if
  355.   put newText into field destinationField
  356.   if count(underLineList) > 0 then
  357.     repeat with charList in underLineList
  358.       set startChar to getAt(charList, 1)
  359.       set endChar to getAt(charList, 2)
  360.       set the textStyle of char startChar to endChar of field destinationField to "underline"
  361.     end repeat
  362.   end if
  363.   puppetSprite(gNextPageChannel, 1)
  364.   puppetSprite(gPrevPageChannel, 1)
  365.   if gCurrentPage > 1 then
  366.     set the loc of sprite gPrevPageChannel to point(202, 468)
  367.   else
  368.     set the locH of sprite gPrevPageChannel to -1000
  369.   end if
  370.   if gCurrentPage < numPages then
  371.     set the loc of sprite gNextPageChannel to point(629, 468)
  372.   else
  373.     set the locH of sprite gNextPageChannel to -1000
  374.   end if
  375.   set the visible of sprite gImageChannel to showImageChannel
  376.   set the visible of sprite gMovieChannel to showMovieChannel
  377.   set the visible of sprite gTextFieldChannel to 1
  378.   if showImageChannel then
  379.     set the loc of sprite gImageChannel to ImageLoc
  380.   end if
  381.   if showMovieChannel then
  382.     set the loc of sprite gMovieChannel to MovieLoc
  383.   end if
  384.   set the loc of sprite gTextFieldChannel to fieldLoc
  385.   if stringp(pageMovie) then
  386.     if onPC then
  387.       sound stop 1
  388.       sound stop 2
  389.     end if
  390.     set the visible of sprite QTsliderChannel to 1
  391.     spriteVisibles(27, 31, 1)
  392.     puppetSprite(QTsliderChannel, 1)
  393.     set the stopTime of sprite gMovieChannel to the duration of cast MovieCastNum
  394.     set the movieRate of sprite gMovieChannel to 1
  395.     puppetSprite(QTPlayChannel, 1)
  396.     set the castNum of sprite QTPlayChannel to the number of member "pause.up"
  397.     set videoPlayState to #play
  398.   end if
  399.   if stringp(pageMovieInAWindow) and objectp(myMIAW) then
  400.     set the visible of sprite QTsliderChannel to 1
  401.     spriteVisibles(27, 31, 1)
  402.     puppetSprite(QTsliderChannel, 1)
  403.     open(myMIAW)
  404.     puppetSprite(QTPlayChannel, 1)
  405.     set the castNum of sprite QTPlayChannel to the number of member "pause.up"
  406.     set videoPlayState to #play
  407.   end if
  408.   if stringp(pageApp) then
  409.     nothing()
  410.   end if
  411. end
  412.  
  413. on updateSubMenuWindow
  414.   tell SubMenuWindow
  415.     doMenu(field "SubMenu")
  416.   end tell
  417.   alert("Boo!2")
  418. end
  419.  
  420. on checkIfOpen aLine
  421.   set LevelsDeep to count(gCurrentMenuHierarchy)
  422.   set LevelSum to 0
  423.   if LevelsDeep > 0 then
  424.     repeat with i = 1 to LevelsDeep
  425.       set LevelSum to LevelSum + getAt(gCurrentMenuHierarchy, i)
  426.       if LevelSum = aLine then
  427.         return 1
  428.       end if
  429.     end repeat
  430.   end if
  431.   return 0
  432. end
  433.  
  434. on displaySubMenu thePassedInLine
  435.   global gCurrentSubMenuLines, gCurrentMenuHierarchy, gCurrentMenuList, gCurrentLevelSelect
  436.   if thePassedInLine > 0 then
  437.     set whichLine to thePassedInLine
  438.   else
  439.     set whichLine to gSubMenuLine
  440.   end if
  441.   set oldLevelSelect to gCurrentLevelSelect
  442.   set theTopic to gMenuItemClicked
  443.   set theDepthAndState to getMenuDepth(theTopic)
  444.   set theDepth to getAt(theDepthAndState, 1)
  445.   if theDepth = 1 then
  446.     set gCurrentTopic to theTopic
  447.     set gCurrentSubTopic to EMPTY
  448.   else
  449.     set gCurrentSubTopic to theTopic
  450.   end if
  451.   set theState to getAt(theDepthAndState, 2)
  452.   if theState = "+" then
  453.     set thisMenuOpen to checkIfOpen(whichLine)
  454.     if not thisMenuOpen then
  455.       repeat with i = count(gCurrentMenuHierarchy) down to theDepth
  456.         deleteAt(gCurrentMenuHierarchy, i)
  457.       end repeat
  458.       set thisLevel to getSpecificMenu(gCurrentMenuHierarchy, theDepth, gCurrentMenuList)
  459.       repeat with i = 1 to the number of lines in thisLevel
  460.         if line i of thisLevel contains theTopic then
  461.           append(gCurrentMenuHierarchy, i)
  462.           set gCurrentLevelSelect to [theDepth, i]
  463.           exit repeat
  464.         end if
  465.       end repeat
  466.       set theNewMenu to getSpecificMenu(gCurrentMenuHierarchy, 1, gCurrentMenuList)
  467.       set tempLine to 0
  468.       repeat with i = 1 to count(gCurrentMenuHierarchy)
  469.         set linesDown to getAt(gCurrentMenuHierarchy, i)
  470.         set tempLine to tempLine + linesDown
  471.         put "+" into char (i * 3) - 2 of line tempLine of theNewMenu
  472.       end repeat
  473.       put theNewMenu into field "Submenu"
  474.       tell SubMenuWindow
  475.         doMenu(theNewMenu)
  476.       end tell
  477.     else
  478.       repeat with i = count(gCurrentMenuHierarchy) down to theDepth
  479.         deleteAt(gCurrentMenuHierarchy, i)
  480.       end repeat
  481.       set thisLevel to getSpecificMenu(gCurrentMenuHierarchy, theDepth, gCurrentMenuList)
  482.       set thisTopicName to char theDepth * 3 to length(theTopic) of theTopic
  483.       repeat with i = 1 to the number of lines in thisLevel
  484.         if line i of thisLevel contains thisTopicName then
  485.           set gCurrentLevelSelect to [theDepth, i]
  486.           exit repeat
  487.         end if
  488.       end repeat
  489.       set theNewMenu to getSpecificMenu(gCurrentMenuHierarchy, 1, gCurrentMenuList)
  490.       put theNewMenu into field "Submenu"
  491.       tell SubMenuWindow
  492.         doMenu(theNewMenu)
  493.       end tell
  494.     end if
  495.   end if
  496.   if theState = EMPTY then
  497.     set tempHierarchy to []
  498.     if theDepth > 1 then
  499.       repeat with i = 1 to theDepth - 1
  500.         append(tempHierarchy, getAt(gCurrentMenuHierarchy, i))
  501.       end repeat
  502.     end if
  503.     set thisLevel to getSpecificMenu(tempHierarchy, theDepth, gCurrentMenuList)
  504.     repeat with i = 1 to the number of lines in thisLevel
  505.       if line i of thisLevel contains theTopic then
  506.         set gCurrentLevelSelect to [theDepth, i]
  507.         exit repeat
  508.       end if
  509.     end repeat
  510.   end if
  511.   if count(gCurrentMenuHierarchy) > 0 then
  512.     set currentExpanded to getAt(gCurrentMenuHierarchy, 1)
  513.   else
  514.     set currentExpanded to 0
  515.   end if
  516.   set theLevel to getAt(gCurrentLevelSelect, 1)
  517.   set theSelect to getAt(gCurrentLevelSelect, 2)
  518.   if (theLevel = 1) and (theSelect > currentExpanded) then
  519.     set theLine to whichLine
  520.   else
  521.     set theLine to 0
  522.     repeat with i = 1 to theLevel - 1
  523.       set theLine to theLine + getAt(gCurrentMenuHierarchy, i)
  524.     end repeat
  525.     if count(gCurrentMenuHierarchy) >= theLevel then
  526.       if getAt(gCurrentMenuHierarchy, theLevel) < theSelect then
  527.         set expandedMenu to getSpecificMenu(gCurrentMenuHierarchy, theLevel + 1, gCurrentMenuList)
  528.         set theLine to theLine + the number of lines in expandedMenu
  529.       end if
  530.     end if
  531.     set theLine to theLine + theSelect
  532.   end if
  533.   tell SubMenuWindow
  534.     drawHiliteSubMenu(theLine)
  535.   end tell
  536.   if gCurrentLevelSelect <> oldLevelSelect then
  537.     newDisplayText(gCurrentMenuList, "Submenu Text", thePassedInLine)
  538.   end if
  539. end
  540.  
  541. on doInstall
  542.   global watchCursorShowing, jumpedToExternal, InstallerPath, MacInstaller, PCInstaller
  543.   hideHilite(1)
  544.   cursor(4)
  545.   set watchCursorShowing to 1
  546.   if the machineType = 256 then
  547.     set theSep to "\"
  548.   else
  549.     set theSep to ":"
  550.   end if
  551.   set thePath to InstallerPath
  552.   if the machineType <> 256 then
  553.     makeAlertBox([#WaitForApplication, "the installer"], "doCancel")
  554.     set jumpedToExternal to the ticks
  555.     cursor(4)
  556.     open(thePath & MacInstaller)
  557.   else
  558.     makeAlertBox([#WaitForApplication, "the installer"], "doCancel")
  559.     set jumpedToExternal to the ticks
  560.     cursor(4)
  561.     open(thePath & PCInstaller)
  562.   end if
  563. end
  564.